package com.tanger.im.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.tanger.common.jpa.IDEntity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;

/**
 * @Description IM用户聊天窗口实体类
 * @Author Hchenbin
 * @Date 2023/12/25 16:28
 * @Version 1.0
 */
@Data
@Entity
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Api(value = "IMUserRecord", tags= " IM用户聊天窗口实体类")
@Table(name = "im_user_record")
public class ImUserRecord extends IDEntity implements Serializable {

	@Column(columnDefinition = "bigint(20) DEFAULT NULL COMMENT 'IM发起用户ID'")
	@ApiModelProperty(value = "IM发起用户ID")
	private Long fuId;
	@Column(columnDefinition = "bigint(20) NOT NULL COMMENT 'IM接收用户ID/组群ID'")
	@ApiModelProperty(value = "IM接收用户ID/组群ID")
	private Long tuId;
	@Column(columnDefinition = "varchar(200) DEFAULT NULL COMMENT '组群/聊天用户JSON'")
	@ApiModelProperty(value = "姓名")
	private String nameExtends;
	@Column(columnDefinition = "int(1) NOT NULL COMMENT '消息类型(1.单聊 2.群聊)'")
	@ApiModelProperty(value = "消息类型(1.单聊 2.群聊)")
	private Integer type;
	@Column(columnDefinition = "varchar(256) DEFAULT NULL COMMENT '记录内容'")
	@ApiModelProperty(value = "记录内容")
	private String content;
	@Column(columnDefinition = "varchar(80) NOT NULL COMMENT '记录KEY'")
	@ApiModelProperty(value = "记录KEY")
	private String md5Key;
	@Column(columnDefinition = "bigint(20) DEFAULT NULL COMMENT '最新记录时间'")
	@ApiModelProperty(value = "最新记录时间")
	private Long lastTime;
	@TableField(exist = false)
	@ApiModelProperty(value = "离线消息条数")
	private Integer offLineTotal;
}
